package com.ruoyi.common.tools.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum ServiceTypeEnum {

	a01(1 , "清扫保洁"),
	a03(2 , "垃圾运收"),
	a05(3 , "市政公厕管养"),
	a06(4 , "道路绿化管养"),
	a07(5 , "公园管养"),
	a09(6 , "其它管养"),
	a08(7 , "路灯管养"),
	a02(8 , "垃圾分类督导和投放点设施维护"),
	a04(9 , "四害消杀"),
	; //其它管养 , 城市管家

	private int code;

	private String serviceType;

	public static ServiceTypeEnum getServiceTypeEnumByCode(int code) {
		for (ServiceTypeEnum s : ServiceTypeEnum.values()) {
			if (s.code == code) {
				return s;
			}
		}
		return null;
	}

	public static String getServiceTypeByCode(int code) {
		for (ServiceTypeEnum s : ServiceTypeEnum.values()) {
			if (s.code == code) {
				return s.getServiceType();
			}
		}
		return null;
	}

	public static int getCodeByServiceType(String serviceType) {
		for (ServiceTypeEnum s : ServiceTypeEnum.values()) {
			if (s.serviceType.equals(serviceType)) {
				return s.code;
			}
		}
		return -1;
	}
}
